Skip to content

Instantly share code, notes, and snippets.

@perkinslr
perkinslr / regexfind.py
Created July 24, 2018 02:17
Regex Specificity Matcher
import re
def _exapnd_regex(a, p, out_strings):
one = False
last = 0
d = p.finditer(a)
for e in d:
one = True
grp = e.group()
@crock
crock / RangeSlider.js
Last active May 15, 2024 18:14
Multi-handle range slider input (HTML5 Web Component)
import { polyfillDeclarativeShadowDom } from "./pollyfill";
/**
* Multi-handle range slider input Web Component
* @class RangeSlider
* @extends HTMLElement
* @property {number} min - Minimum value of the slider
* @property {number} max - Maximum value of the slider
* @property {number} step - Step value of the slider
* @property {number[]} values - Array of values for each handle
@abul4fia
abul4fia / ligth_theme.py
Last active May 15, 2024 18:13
Light theme for manim
# Put this file in the same folder than your manim script
# and start your script with:
#
# import light_theme
from manim import *
config.background_color = WHITE
# Those are objects which are WHITE by default

Comment utiliser Matomo sans bannière de consentement

  1. permettre aux visiteurs de refuser d’être suivis (Opt-out) (exemple)
  2. désactiver les cookies + s’assurer qu’on ne track pas de données personnelles dans Matomo (même sans cookie)
  3. anonymiser les IP : anonymiser au moins 2 octets via l’admin de Matomo
  4. anonymiser le référent via l’admin de Matomo
  5. exclure les données personnelles des URL et titre des pages
  6. exclure les données personnelles des variables personnalisées, dimensions, évènements (usage avancé)
  7. masquer les données personnelles dans les heatmaps et les enregistrements d’écran (usage avancé)
  8. exclure les identifiants de commande de commerce électronique (usage avancé)
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 15, 2024 18:11
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active May 15, 2024 18:06
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@mindplace
mindplace / git_and_github_instructions.md
Last active May 15, 2024 18:05
Pushing your first project to github

1. Make sure git is tracking your project locally

Do you need a refresher on git? Go through Codecademy's git course.

  1. Using your terminal/command line, get inside the folder where your project files are kept: cd /path/to/my/codebase. → You cannot do this simply by opening the folder normally, you must do this with the command line/terminal.
    → Do you need a refresher on using your command line/terminal? I've compiled my favorite resources here.

  2. Check if git is already initialized: git status

@chrisvoncsefalvay
chrisvoncsefalvay / grimdarkinate.py
Last active May 15, 2024 18:05
grimdarkinator
import base64
from typing import Union, Literal, Optional
import openai
import requests
import os, io
from PIL import Image
from openai import OpenAI
import uuid
import argparse
@tonyxu-io
tonyxu-io / edge-lite.mobileconfig
Last active May 15, 2024 18:04
Edge Configuration Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadDisplayName</key>
<string>tony-edge-lite</string>
<key>PayloadIdentifier</key>
<string>io.tonyxu.edge-lite</string>
<key>PayloadType</key>
<string>Configuration</string>